package com.glacier.cloud.product.controller;

import com.glacier.cloud.product.entity.dto.cmd.ProductStockLockCmd;
import com.glacier.cloud.product.service.ProductService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * date 2023-12-04 10:35
 *
 * @author glacier
 * @version 1.0
 */
@RestController
@RequestMapping("/product")
public class ProductController {
    @Resource
    private ProductService productService;

    @GetMapping("/{productId}")
    public String getProduct(@PathVariable("productId") Integer productId) {
        return "sp" + productId;
    }

    @PostMapping("/lockStock")
    public int lockStock(@RequestBody ProductStockLockCmd productStockLockCmd) {
        return productService.lockStock(productStockLockCmd);
    }

    @PostMapping("/list")
    public String listProduct() {
        return "商品列表";
    }
}
